/**
 * Created by kaki on 2017/10/20.
 */
import fetch from '@/utils/fetch'
// 列出所有赠卡规则
export const GetAllGiftCards = (page, per_page = 10, keyword) => {
  return fetch({
    url: '/api/staff/gift-cards?include=conditions.cards_type,cards_type',
    method: 'get',
    params: {
      page,
      per_page,
      keyword
    }
  })
}
// 显示一条赠卡规则
export const Show = (id) => {
  return fetch({
    url: '/api/staff/gift-cards/' + id + '?include=conditions.cards_type,cards_type',
    method: 'get'
  })
}
// 获取所有卡种
export const GetAllCardType = () => {
  return fetch({
    url: '/api/staff/cards/types?is_pubilsh=1',
    method: 'get'
  })
}

// 创建一个赠卡活动
export const Create = (data) => {
  return fetch({
    url: '/api/staff/gift-cards',
    method: 'post',
    data
  })
}

// 更新一个赠卡活动
export const Update = (id, data) => {
  return fetch({
    url: `/api/staff/gift-cards/${id}`,
    method: 'put',
    data
  })
}

// 更新一个赠卡活动
export const Delete = (id) => {
  return fetch({
    url: `/api/staff/gift-cards/${id}`,
    method: 'delete'
  })
}
